import request from '@/utils/request'

const api_name = '/admin/banner'

export default {

  getList() {
    return request({
      url: api_name,
      method: 'get'
    })
  },
  getPageList(page, limit, bannerQuery) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'post',
      data: bannerQuery
    })
  },
  removeById(bannerId) {
    return request({
      url: `${api_name}/remove/${bannerId}`,
      method: 'delete'
    })
  },
  save(banner) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: banner
    })
  },
  getById(id) {
    return request({
      url: `${api_name}/get/${id}`,
      method: 'get'
    })
  },
  updateById(banner) {
    return request({
      url: `${api_name}/update/${banner.id}`,
      method: 'put',
      data: banner
    })
  }
}
